package com.gitee.zhanyao.cloud.security.service.impl;

import com.gitee.zhanyao.cloud.security.entity.system.SysUserAccount;
import com.gitee.zhanyao.cloud.security.service.SysUserAccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

@Service("userDetailsService")
public class UserDetailServiceImpl implements UserDetailsService {

    @Autowired
    private SysUserAccountService sysUserAccountService;

    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
        //SysUserAccount sysUserAccount = sysUserAccountService.findByLoginName(username);
        return new User("zhanyao", "$2a$10$BlK6FSCLe3HGO.2kA9NCVe3Uazhzfw3lG9LsELak817WppM5kAIqy", new ArrayList<>());
    }

}
